package domean;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;

import states.States;

public class Wuerfel extends JPanel{
	
	private int zahl;
	
	public int wuerfeln(){
		zahl = (int)(Math.random()*6+1);
//		final JDialog dialog = new JDialog();
//		 dialog.setLayout(null);
//		 dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
//		 dialog.setBounds(300, 225, 200, 100);
//		 JLabel label = new JLabel();
//		 label.setBounds(5, 5, 200, 50);
//		 label.setText(String.valueOf(zahl));
//		 label.setSize(50,30);
//		 dialog.add(label);
//	        Timer timer = new Timer(2000, new ActionListener() {
//	            public void actionPerformed(ActionEvent e) {
//	                dialog.setVisible(false);
//	                dialog.dispose();
//	            }
//	        });
//	        timer.setRepeats(false);
//	        timer.start();
//
//	        dialog.setVisible(true);
		return zahl;
	}
}
